//
//  ZYLHomeViewController.m
//  XXWeiBo
//
//  Created by mac on 15-1-31.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "ZYLHomeViewController.h"
#import "ZYLTools.h"

@interface ZYLHomeViewController ()

@end

@implementation ZYLHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:@"navigationbar_friendsearch" higImage:@"navigationbar_friendsearch_highlighted" target:self  action:@selector(friendsearch)];
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithImage:@"navigationbar_pop" higImage:@"navigationbar_pop_highlighted" target:self action:@selector(scan)];
}

/**
 *  创建UIBarButtonItem
 *
 *  @param image    默认状态图片
 *  @param higImage 高亮状态图片
 *
 *  @return item
 */
- (UIBarButtonItem *)itemWithImage:(NSString *)image higImage:(NSString *)higImage action:(SEL)action;
{
    UIButton *btn = [[UIButton alloc] init];
    // 设置对应状态图片
    [btn setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:higImage] forState:UIControlStateHighlighted];
    // 设置frame
    btn.size = btn.currentImage.size;
    // 添加监听事件
    [btn addTarget:self action:action forControlEvents:UIControlEventTouchUpInside];
    
    return [[UIBarButtonItem alloc] initWithCustomView:btn];
}

#pragma mark - 内部控制方法
- (void)friendsearch
{
    DDActionLog;
}

- (void)scan
{
    DDActionLog;
}


@end
